<?php
namespace App\Services\Oauth;

use App\Services\CommonConfigService;

/**
 * Class CommonPayService
 * @package app\common\service\pay
 * @Author: TinyMeng <666@majiameng.com>
 * @Created: 2020/8/14
 */
class OauthConfigService extends CommonConfigService
{
    /**
     * 加载配置
     * @param $data
     * @return array|false
     * @author: tinymeng <666@majiameng.com>
     * @ctime:  2021/6/7 18:11
     */
    public function loadConfig($data){
        $domain = (request()->isSecure()?'https':'http').'://'.request()->getHost();

        // oauth登录类config返回回调地址： /oauth/wechat/mobile/app_id
        $data['callback'] = $domain."/".str_replace('_','/',$this->configCode)."/".$this->company['app_id'];
        return $data;
    }
}
